Skip to content

feat: add dynamic open graph metadata for link previews - #5348

Open
imrja8 wants to merge 9 commits into
Dokploy:canaryfrom
imrja8:feat/open-graph-metadata
Open

feat: add dynamic open graph metadata for link previews#5348
imrja8 wants to merge 9 commits into
Dokploy:canaryfrom
imrja8:feat/open-graph-metadata

Conversation

@imrja8

@imrja8 imrja8 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Why needed?

Currently, direct links to a Dokploy instance render generic, unbranded previews, breaking the enterprise white-label experience. See issue #5346 for full details on the problem.

How solving?

We resolve this by dynamically injecting Open Graph <meta> tags during Next.js Server-Side Rendering (_document.tsx).

  1. Database & API:
    • Replaced the redundant metaTitle with an ogImageUrl field in the webServerSettings PostgreSQL schema.
    • Updated the PublicWhitelabelingConfig tRPC service to expose the new ogImageUrl to the frontend.
    • Pushed a database migration to reflect these JSONB changes.
  2. Frontend UI:
    • Added a new "OG Image URL" input field to the Whitelabeling Settings dashboard under Branding.
    • Deprecated the standalone Page Title input, unifying the site title with the core Application Name to clean up the interface.
  3. Next.js SSR Rendering:
    • Modified the document shell (_document.tsx) to read appName, appDescription, and ogImageUrl from the backend cache.
    • Injected <meta property="og:title">, og:description, and og:image dynamically on the first paint to ensure social scrapers correctly fetch the custom branding.
    • Added a highly compressed public/og.png fallback image for instances without enterprise configurations.

Validation

Social share and og things:

View Before & After

Before:
3

After:
after

Dashboard (only enterprise):

View UI Changes Blue and Yellow Modern Certificate of Completion

UI Updates Implemented:

  1. Introduced Open Graph Branding: Added a dedicated OG Image URL field directly alongside the Favicon configuration, allowing enterprise users to fully control their link preview visuals.
  2. Streamlined Metadata Settings: Deprecated the standalone Page Title field from the settings dashboard. The <title> and og:title tags are now globally unified to derive directly from the primary Application Name, eliminating redundancy and cleaning up the user interface.

Checklist

Before submitting this PR, please make sure that:

  • You created a dedicated branch based on the canary branch.
  • You have read the suggestions in the CONTRIBUTING.md file https://github.com/Dokploy/dokploy/blob/canary/CONTRIBUTING.md#pull-request
  • You have tested this PR in your local instance. If you have not tested it yet, please do so before submitting. This helps avoid wasting maintainers' time reviewing code that has not been verified by you.

Issues related

closes #5346

Note to Maintainers (@Siumauricio / @narcisonunez):
In the original issue, I raised open questions regarding the deprecation of the Page Title field and renaming the Metadata & Links section to simply Links. In this PR, I went ahead and implemented these UX enhancements because I believe it significantly unifies and improves the branding experience. However, if you would prefer to keep the Page Title isolated or handle the form differently, I am completely open to reverting/adjusting that part of the logic!

Greptile Summary

This PR adds dynamic Open Graph metadata to the Next.js document shell and extends enterprise whitelabeling with a configurable preview image.

  • Uses the configured application name and description for Open Graph metadata.
  • Adds an absolute fallback URL for the bundled preview image.
  • Replaces the legacy page-title setting with ogImageUrl across the schema, API, dashboard, migration metadata, reset path, and tests.

Confidence Score: 5/5

The PR appears safe to merge, with no outstanding correctness or security issue identified in the latest changes.

The reset payload now matches the renamed schema field, and the fallback Open Graph image is emitted as an absolute URL under the default proxy path. The earlier reset-payload thread was manually resolved without explanation; its current code is nevertheless fully corrected. The other previous finding is fully fixed by prefixing the fallback image path with the request origin.

Reviews (2): Last reviewed commit: "chore: revert accidental package.json ch..." | Re-trigger Greptile

Context used:

@imrja8
imrja8 requested a review from Siumauricio as a code owner September 4, 2026 17:03
Comment thread packages/server/src/db/schema/web-server-settings.ts
Comment thread apps/dokploy/pages/_document.tsx Outdated
@imrja8
imrja8 marked this pull request as draft September 4, 2026 17:15
@imrja8
imrja8 marked this pull request as ready for review September 4, 2026 17:22
@narcisonunez

Copy link
Copy Markdown
Collaborator

@imrja8 Please, recreate the migration

@imrja8

imrja8 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

@imrja8 Please, recreate the migration

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamic Open Graph (OG) Metadata Support

2 participants